package com.ruoyi.common.core.response;

/**
 * 返回Object结果
 *
 * @param <T>
 * @author 雷洪飞
 */
public class ObjectResponse<T> extends ResponseResult implements Response {

    /**
     * 返回数据
     */
    private T data;

    public ObjectResponse() {
        super();
    }

    public ObjectResponse(T data) {
        this.code = ResponseEnum.SUCCESS_CODE.getCode();
        this.msg = ResponseEnum.SUCCESS_CODE.getMsg();
        this.data = data;
    }

    public ObjectResponse(String msg, T data) {
        this.code = ResponseEnum.SUCCESS_CODE.getCode();
        this.msg = msg;
        this.data = data;
    }

    public ObjectResponse(String responseCode, String responseMsg, T datas) {
        this.code = responseCode;
        this.msg = responseMsg;
        this.data = datas;
    }

    @Override
    public String getCode() {
        return code;
    }


    @Override
    public String getMsg() {
        return msg;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    /**
     * @return the dateUtils
     */
    public T getData() {
        return data;
    }

    /**
     * @param data the dateUtils to set
     */
    public void setData(T data) {
        this.data = data;
    }

    /*
     * (non-Javadoc)
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "ObjectResponse [code=" + code + ", msg=" + msg + ", dateUtils=" + data + "]";
    }

}
